package cn.rick.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

/**
 * <p>
 *
 * </p>
 *
 * @author house_store
 * @since 2022-10-29 14:46:14
 */
@Getter
@Setter
@TableName("build_category")
@ApiModel(value = "主材料分类", description = "主材料分类")
public class BuildCategory implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty("父级分类id")
    @TableField("parent_id")
    private Long parentId;

    @ApiModelProperty("祖籍列表")
    @TableField("ancestors")
    private String ancestors;

    @ApiModelProperty("分类名称")
    @TableField("name")
    private String name;

    @ApiModelProperty("分类排序")
    @TableField("order_num")
    private Integer orderNum;

    @ApiModelProperty("分类中材料数量")
    @TableField("materials_count")
    private Integer materialsCount;

    @ApiModelProperty("分类状态")
    @TableField("status")
    private String status;

    @ApiModelProperty("删除标志")
    @TableField("del_flag")
    @TableLogic
    private String delFlag;

    @TableField("create_by")
    private String createBy;

    @TableField("create_time")
    private LocalDateTime createTime;

    @TableField("update_by")
    private String updateBy;

    @TableField("update_time")
    private LocalDateTime updateTime;

    @TableField(exist = false)
    @ApiModelProperty("子级分类")
    private List<BuildCategory> children;
}
